#ifndef __SYS_CFG_H__
#define __SYS_CFG_H__

#ifdef __cplusplus
extern "C" {
#endif

struct SubKey;
struct MainKey;
struct CfgLine;
struct SysConfig;

DList* sys_cfg_get_sub_key_list(struct MainKey* mk);
struct MainKey* sys_cfg_main_key_create_from_str(int line_nubmer, char* line);
struct SubKey* sys_cfg_sub_key_create_from_str(int line_number, char* line);
Ret sys_cfg_append_main_key(struct SysConfig* thiz, struct MainKey* mk);
Ret sys_cfg_append_sub_key(struct SysConfig* thiz, struct SubKey* sk);
struct SysConfig* sys_cfg_create();
Ret sys_cfg_patch_main_key(struct SysConfig* thiz, const char* dst_mk_str, const char* src_mk_str);
Ret sys_cfg_delete_main_key(struct SysConfig* thiz, const char* key_name);
struct MainKey* sys_cfg_get_main_key(struct SysConfig* thiz, const char* key_name);
void sys_cfg_destroy(struct SysConfig* thiz);
char* sys_cfg_sub_key_get_key(struct SubKey* sub);
char* sys_cfg_sub_key_get_value(struct SubKey* sub);
void sys_cfg_dump(struct SysConfig* thiz, char* file_path);

Ret cfg_line_delete_by_line_number(DList* cfg_line, int line_number);

#ifdef __cplusplus
}
#endif

#endif /* __SYS_CFG_H__ */
